Skip to content

Conversation

@nilsquet
Copy link
Contributor

@nilsquet nilsquet commented Aug 29, 2025

Issue #, if available:
#974

Description of changes:
Starting with the changes from #993 and #1002, the barrier instruction is implemented as a CompilerDirective. To this end, changes were necessary in a few files.

Testing done:
tox

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@nilsquet nilsquet changed the title feature: add barrier for circuits feature: add barrier instruction Aug 29, 2025
@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b98a75e) to head (8db5a31).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1118   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          162       162           
  Lines        10387     10474   +87     
  Branches      1262      1276   +14     
=========================================
+ Hits         10387     10474   +87     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nilsquet nilsquet marked this pull request as ready for review September 3, 2025 18:26
@nilsquet nilsquet requested a review from a team as a code owner September 3, 2025 18:26
"""
target_qubits = self.qubits if target is None else QubitSet(target)

if target_qubits:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because self.qubits can be None?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation was to not have any effect when adding a barrier to an empty circuit.

@nilsquet
Copy link
Contributor Author

nilsquet commented Sep 4, 2025

Since the linter was not happy anymore with the added complexity introduced here, I had to refactor the ascii_circuit_diagram.py and text_circuit_diagram_utils.py a bit.

@nilsquet nilsquet merged commit 514b695 into main Sep 5, 2025
24 checks passed
@nilsquet nilsquet deleted the feature/barrier-instruction branch September 5, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants